import { SkillModel } from "server/models/Skill";

export default defineEventHandler(async (event) => {
  try {
    // 获取所有技能（扁平列表）
    const skills = await SkillModel.getAllSkills();

    return {
      success: true,
      message: "获取技能信息成功",
      data: skills,
    };
  } catch (error: any) {
    console.error("获取技能信息失败:", error);

    return {
      success: false,
      message: `获取技能信息失败: ${error.message}`,
      data: null,
    };
  }
});
